package org.codeCard.panel;

import com.updateNew.MyIsif;

import javax.swing.*;
import java.awt.*;

/**
 * @author HGC<br>
 * @time 2019年12月20日 上午9:49:49<br>
 * @class 类名:PartnerCardJpanel 伙伴卡片布局 <br>
 */
public class CodeCardJPanel extends JPanel {
    private CardLayout cardLayout;

    private CodeCardBuyJPanel bjcz1Jpanel;
    private CodeCardSaleJPanel bjcz2Jpanel;

    public CodeCardJPanel() {
        cardLayout = new CardLayout();
        if (MyIsif.getStyle().equals("水墨UI")) {
            this.setPreferredSize(new Dimension(481,550));
        }else{
            this.setPreferredSize(new Dimension(452, 527));

        }
        this.setOpaque(false);
        this.setLayout(cardLayout);
//        this.remove(bjcz1Jpanel);
//        this.remove(bjcz2Jpanel);

        bjcz1Jpanel = new CodeCardBuyJPanel();
        bjcz2Jpanel = new CodeCardSaleJPanel();
        this.add("bjcz1Jpanel", bjcz1Jpanel);
        this.add("bjcz2Jpanel", bjcz2Jpanel);

    }
    public void rep(int type){
        this.remove(this.bjcz1Jpanel);
        this.remove(this.bjcz2Jpanel);

        bjcz1Jpanel = new CodeCardBuyJPanel();
        bjcz2Jpanel = new CodeCardSaleJPanel();
        if(type == 1){
            this.add("bjcz1Jpanel", bjcz1Jpanel);
            this.add("bjcz2Jpanel", bjcz2Jpanel);
        }else{
            this.add("bjcz2Jpanel", bjcz2Jpanel);
            this.add("bjcz1Jpanel", bjcz1Jpanel);
        }

//        if(MyIsif.getStyle().equals("水墨UI")) {
//            if(type == 1){
//
//                BjczMainJpanel.imgPath = "inkImg/background/底图1.png";
//            }else{
//                BjczMainJpanel.imgPath = "inkImg/background/底图2.png";
//
//            }
//        }else{
//            if(type == 1){
//
//                BjczMainJpanel.imgPath = "inkImg/hongmu/bjczBJ1.png";
//            }else{
//                BjczMainJpanel.imgPath = "inkImg/hongmu/bjczBJ2.png";
//
//            }
//
//        }
    }

    public CardLayout getCardLayout() {
        return cardLayout;
    }

    public void setCardLayout(CardLayout cardLayout) {
        this.cardLayout = cardLayout;
    }

    public CodeCardBuyJPanel getBjcz1Jpanel() {
        return bjcz1Jpanel;
    }

    public void setBjcz1Jpanel(CodeCardBuyJPanel bjcz1Jpanel) {
        this.bjcz1Jpanel = bjcz1Jpanel;
    }

    public CodeCardSaleJPanel getBjcz2Jpanel() {
        return bjcz2Jpanel;
    }

    public void setBjcz2Jpanel(CodeCardSaleJPanel bjcz2Jpanel) {
        this.bjcz2Jpanel = bjcz2Jpanel;
    }
}

